﻿@using CMSMVC4.MultiResource
@model CMSMVC4.Slide

@{
    ViewBag.Title = Admin.UploadImage;
}

<div class="row-fluid">
    <div class="span7" style="width: 100%">
        <div class="box paint color_10">
            <div class="title">
                <h4><span>@Admin.UploadImage</span> </h4>
            </div>
            <div class="content" style="width: 65%">
                @using (Html.BeginForm("Add", "Slideshow", FormMethod.Post, new { @class = "form-horizontal cmxform", autocomplete = "off" }))
                {
                    <div class="form-row control-group row-fluid">
                        <label class="control-label span3">Url <span class="help-block">Url</span> </label>
                        <div class="controls span7">
                            @Html.TextBoxFor(x => x.Url, new {placeholder = "Url", @class = "span12"})
                        </div>
                    </div>
                    <div class="form-row control-group row-fluid">
                        <label class="control-label span3">@Admin.Images <span class="help-block">@Admin.Images</span> </label>
                        <div class="controls span7">
                            @Html.TextBoxFor(x => x.Image, new {@class = "span12", style = "float:left;width:250px;"})
                            <input class="btn btn-danger" id="Chon_Slide" type="button" value="@Admin.SelectImages" style="float: right; height: 33px"/>
                        </div>
                    </div>
                          <div class="form-actions row-fluid">
                        <div class="span7 offset3">
                            <button type="submit" class="btn btn-primary">@Admin.SaveChange</button>

                        </div>
                    </div>
                }
            </div>
        </div>
    </div>
</div>

@*@using (Html.BeginForm("Add", "Slideshow", FormMethod.Post, new { @class = "form-horizontal cmxform", autocomplete = "off" }))
{
    <div>
        link:@Html.TextBoxFor(x => x.Url, new { placeholder = "Url" })
    </div>
    <div>
        Img: @Html.TextBoxFor(x => x.Image)
        <input id="Chon_Slide" type="button" value="Chon Anh" />
    </div>
    <input type="submit" value="Save" />
}*@
<script language="javascript" type="text/javascript">

    $(function () {
        $("#Chon_Slide").click(function () {
            var finder = new CKFinder();
            finder.selectActionFunction = function (fileUrl) {
                $("#Image").val(fileUrl);
            };
            finder.popup();
        });
    });
</script>
